package org.lds.logger.config.filter;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.lds.logger.config.level.Level;
import org.lds.logger.event.LoggerEvent;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class LevelGlobalFilter extends AbstractGlobalFilter {
    private Level level;

    @Override
    public boolean shouldFilter(LoggerEvent loggerEvent) {
        return loggerEvent.getLevel().getCode() < level.getCode();
    }

}
